/*
package com.aaa.java14;

import java.util.*;

*
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2022/7/18 9:00
 * @description：ListTest
 * @modified By：
 * @version: 1.0


public class ListTest {
    public static void main(String[] args) {
        //实例化一个空list
        List<Teacher> teacherList= new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            Teacher teacher = new Teacher();
            teacher.setId(i+1000);
            teacher.setName("老师"+i);
            //获取10000以内的随机数
            int sal=new Random().nextInt(10000);
            //设置工资
            teacher.setSal(sal);
            //实例化对象之后，及时存入list集合中
            teacherList.add(teacher);
        }
        System.out.println("排除之前");
        for (Teacher teacher : teacherList) {
            System.out.println(teacher);
        }
        System.out.println("排除之后");
        Collections.sort(teacherList);
        for (Teacher teacher : teacherList) {
            System.out.println(teacher);
        }
    }
}
*/
